home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.tcl,comp.unix.programmer,comp.unix.questions,comp.unix.shell,comp.lang.awk,comp.lang.c,comp.lang.perl.misc,comp.programming,comp.software-eng
- Subject: Re: Appropriate Tools and Approach for Kill Application
- Date: 17 Apr 1996 13:18:15 -0700
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4l3jm7INNi43@keats.ugrad.cs.ubc.ca>
- References: <Pine.SOL.3.91.960417003525.18392A-100000@sun22>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <Pine.SOL.3.91.960417003525.18392A-100000@sun22>,
- <mjw@pobox.com> wrote:
- >I am interested in writing a fancy program to kill processes and could use
- >some advice on appropriate tools, languages, and approaches.
- >
- >I would like the program to function as follows:
- >
- >There will exist a command line switch to correspond to each process
- >characterstic. A process characteristic will most likely be each of the
- >fields displayed in a full process list (ps -ef on many systems.) Using
- >these switches, a user will be able to specify one or more characteristics
- >with the ability to use regular expressions. Also, where appropriate, he
- >or she may include processes to be killed by using equalities/
- >inequalities.
- >
- >
- >i.e.
- >
- >kill -n x*
- >
- >would kill xterm, xrn, xmosaic, etc.
- >
- >
- >kill -n x* -t >=5h2m
- >
- >would kill all processes beginning with lowercase x and which have been
- >running at least than five hours and two minutes.
-
- Basically, the ``killall'' command that distributes with Slackware linux has
- some functionality along this vein. If you type ``kilall xterm'', it will kill
- all xterms.
-
- >Can you please help with the following questions:
- >
- >1) What tools or languages would be best to use? C, Tcl, scripting langs,
- >LEX & YACC, etc.
-
- I'd write an awk script which processes the output of ps, but I'd try to patch
- it together using POSIX.2 shell scripting first, in conjunction with grep and
- friends. As a last resort, I'd resort to things that are not POSIX.2
- standardized, like perl, etc.
-
- >2) What are some good strategies and their pros and cons for implementing
- >this functionality in different software forms i.e. script, program,
- >combination, etc.
-
- A script is likely to be easier to port than a C program.
-
- >3) Are there any guidelines or tips for designing the syntax to jive with
- >standard practice?
-
- Hell no! Does comp.macintosh.programmer appear in any of the newsgroups you
- spammed? :)
-
- Don't even DARE to be consistent with any other command, you blasphemer! :))
-
-
- Seriously, the ``find'' syntax might be cool.
-
- findjob -name "x*" -user bob -exec kill -STOP {} \;
-
- Find is the most user-friendly program there ever was, so that's the one to
- emulate.
- --
- I'm not really a jerk, but I play one on Usenet.
-